const XLSX = require('xlsx');

function readExcelFile(filePath) {
    const workbook = XLSX.readFile(filePath);
    const sheetName = workbook.SheetNames[1];
    const sheet = workbook.Sheets[sheetName];
    const data = XLSX.utils.sheet_to_json(sheet);
    // console.log(data);
    const columnNames = Object.keys(data[0]);
    console.log(columnNames);
    columnNames.forEach(columnName => {
        const columnData = data.map(item => item[columnName]);
        console.log(`列名称 '${columnName}':`, columnData);
    });
}

// 替换为您的 Excel 文件的实际路径
readExcelFile('call_1.xlsx');